Skip to content

MSC4487: Deprecate internal use of matrix.to navigation#4487

Open
HarHarLinks wants to merge 2 commits into
matrix-org:mainfrom
HarHarLinks:HarHarLinks/deprecate-internal-matrix.to
Open

MSC4487: Deprecate internal use of matrix.to navigation#4487
HarHarLinks wants to merge 2 commits into
matrix-org:mainfrom
HarHarLinks:HarHarLinks/deprecate-internal-matrix.to

Conversation

@HarHarLinks

@HarHarLinks HarHarLinks commented Jun 3, 2026

Copy link
Copy Markdown
Contributor

Rendered

I am at the time of writing employed by Nordeck, Matrix community member, and Member of The Matrix.org Foundation Governing Board. This proposal is written and published with my role as a community member based on this suggestion.

Implementations:

Signed-off-by: HarHarLinks <2803622+HarHarLinks@users.noreply.github.com>
Signed-off-by: HarHarLinks <2803622+HarHarLinks@users.noreply.github.com>
@tulir tulir added proposal A matrix spec change proposal. Process state. kind:maintenance MSC which clarifies/updates existing spec labels Jun 3, 2026

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Implementation requirements:

  • Product teams from clients supporting this behaviour

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What does this have to do with product teams? 🤔 It's an entirely internal technical detail that shouldn't be visible to users at all

I don't think this needs any implementation, since the spec already allows using matrix URIs, there are already multiple clients that correctly handle matrix: URIs in <a> tags, and this is just a deprecation rather than a removal.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

While I get where "Product teams" comes from I just wanted to mention that this feels a bit weird as a term considering a lot of clients are not done by companies in matrix ecosystem. So lots of them don't have such a team. This term feels almost a bit out of touch with the reality of matrix ecosystem. Sorry for being nitpicky. This isn't meant to be rude. I just wanted to mention this for next time maybe.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indeed, the MSC is deliberately very conservative in that regard.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What does this have to do with product teams? 🤔 It's an entirely internal technical detail that shouldn't be visible to users at all

Clients expose matrix.to in several places to users and this proposal requires that those clients don't do that. Why those clients haven't already made the switch is essentially the product decision to be made here.

The implementation requirements for a deprecation is typically evidence that it's safe to queue for removal. Because clients still actively use matrix.to by choice, we cannot queue this for removal.

If the proposal's purpose is to discourage use without targeting removal then it should not be using deprecation.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We'd then need implementations of all of that to show it's feasible to rewrite matrix: URIs to matrix.to URLs.

  • Client (modern desktop)
  • Client (modern browser)
  • Client (iOS)
  • Client (Android)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Was confused by why clients would need to rewrite matrix: URIs to matrix.to URLs, but apparently it's because at least Element X decided that pills need a "copy link" context menu option. It's technically an existing spec compliance issue (the spec already allows using matrix: for pills), but it's fair to consider those before having the spec recommend actively switching to matrix: URIs over matrix.to URLs, as such a recommendation will cause clients to hit the spec compliance issues a lot more.

It's probably also better to start with having the spec just recommend matrix: URIs ("Clients SHOULD use matrix: URIs when sending user and room mentions") before a formal deprecation of matrix.to in pills.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

From a client developer perspective (so-called product team 😂), I can confirm : Every major client supports the Matrix URI scheme. With the acceptance of matrix: as standardized scheme, even web-clients can register to handle incoming Matrix URLs simple as by including it into the web app manifest.

Matrix URIs are easier to handle since they tend to be less buggy. E.g., many Matrix clients as well as users manually writing links tend to fail at the URI component encoding of the sigils that's required according to the matrix.to scheme. With standardized Matrix URIs this issue is solved.

Imho, the following should be the way to go :

  • Clients MUST NOT try to handle incoming matrix.to links
  • Clients SHOULD for a transition period internally convert matrix.to links to Matrix URLs
  • Clients MUST NOT send any matrix.to links via Matrix
  • Clients SHOULD offer an option to share a matrix.to link to 3rd party applications (e.g. by email, share intent etc.)
  • Matrix.to MUST convert incorrectly encoded sigils on the fly to show the correct matrix.to URL in the User Agent address bar
  • Matrix.to MUST by default fallback on opening the User Agent's preferred client using a Matrix URL

@HarHarLinks HarHarLinks Jun 7, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pills need a "copy link" context menu option

Sure, per the MSC that is reasonable and even implied as intended.

Client (modern desktop)
Client (modern browser)
Client (iOS)
Client (Android)

I can't help but feel like asking for POC implementations on no less than 4 platforms is chicanery for something that is obviously™️ a trivial find-replace. Why would this be necessary? I would even argue it's so trivial that it doesn't need an implementation. Both parsing and generating of both matrix: and matrix.to URIs to/from IDs is already proven by their respective inclusion in the spec.

Anyway, here's an implementation in bash:

#!/usr/bin/env bash

function convert {
	id="$1"
	if [[ "${id:7:7}" == "roomid/" ]]; then
		id="${id//roomid\//!}"
	elif [[ "${id:7:2}" == "r/" ]]; then
		id="${id//r\//%23}"
	elif [[ "${id:7:2}" == "u/" ]]; then
		id="${id//u\//@}"
	fi
	if [[ "$id" == *"/e/"* ]]; then
		id="${id//\/e\///$}"
	fi
	id="${id//matrix:/https://matrix.to/#/}"
	echo "$id"
}

room_alias='matrix:r/somewhere:example.org'
room_v12='matrix:roomid/somewhere?via=elsewhere.ca'
room_v11='matrix:roomid/somewhere:example.org?via=elsewhere.ca'
user='matrix:u/alice:example.org?action=chat'
alias_event='matrix:r/somewhere:example.org/e/event?via=elsewhere.ca'
v12_event='matrix:roomid/somewhere/e/event?via=elsewhere.ca'

convert "$room_alias"
# https://matrix.to/#/%23somewhere:example.org
convert "$room_v12"
# https://matrix.to/#/!somewhere?via=elsewhere.ca
convert "$room_v11"
# https://matrix.to/#/!somewhere:example.org?via=elsewhere.ca
convert "$user"
# https://matrix.to/#/@alice:example.org?action=chat
convert "$alias_event"
# https://matrix.to/#/%23somewhere:example.org/$event?via=elsewhere.ca
convert "$v12_event"
# https://matrix.to/#/!somewhere/$event?via=elsewhere.ca

Note that while the examples in the spec for matrix.to percent-encode ALL special chars, aiui this isn't required by RFC 3986.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Obligatory reminder that I wrote the steps to world domination matrix: URI scheme support 5 years ago: element-hq/element-web#16875 (comment) - and for as long as I remember, people mostly agreed by these steps, and nobody challenged them. This MSC (@HarHarLinks I owe you your favourite beverage at conf or somewhere for writing it) is a legislation for step 2 because apparently (and yes I'm looking at Element now) some "product teams" just can't prioritise it otherwise.

@turt2live turt2live added the needs-implementation This MSC does not have a qualifying implementation for the SCT to review. The MSC cannot enter FCP. label Jun 3, 2026
## Potential issues

There might be "growing pains" as implementing this MSC effectively forces the ecosystem to at least support parsing
`matrix:` URIs. In reality, most clients already support this as of today.

@HarHarLinks HarHarLinks Jun 3, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

matrix URI (room alias) client support:

  • Nheko 0.12.1-1f083e25: supports both plain text and html formatted
  • Element web 1.12.20: plain text does not pillify and opens matrix.to instead (wtf??? this regressed from 1.11.112), HTML link pillifies and routes internally
  • fractal 13: supports both plain text and html formatted with pillification
  • SchildiNext 0.11.3-test3 (based on Element X 26.05.2) with message renderer rewrite enabled: plain text does not pillify nor linkify properly, HTML link does not pillify but offers to "open with" any installed Matrix client that registered the scheme, including itself
  • Element X Android 26.05.2: plain text does not pillify nor linkify properly, HTML link pillifies
  • Fluffychat 2.6.0: ?
  • Cinny v4.12.2: neither are supported
  • Polycule $current: ?
  • Tammy 2.0.6: supports both plain text and html formatted with pillification

@SpiritCroc SpiritCroc Jun 3, 2026

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FWIW SchildiChat Revenge recently got matrix URI (plaintext) linkification and deeplinking support (to be released soon), just need to bump the message formatting library on Next to get linkification and in-app navigation on that as well

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Element X 26.05.2: plain text does not pillify nor linkify properly, HTML link pillifies

There might be a discrepancy between iOS and Android here - plain-text URIs will link & pillify as expected on iOS.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, I clarified Android above!

@KitsuneRal KitsuneRal Jun 12, 2026

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The matrix URI scheme has had first-class support in Quotient-based clients (Quaternion and NeoChat) since 2021, ftr. Implementing this MSC is almost exactly down to changing a single default in the library for them.


Clients SHALL instead generate `matrix:` URIs when it is clear that:

- a reference to a Matrix entity (room alias, room ID, event within a room, user ID) is going to be sent over Matrix,

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- a reference to a Matrix entity (room alias, room ID, event within a room, user ID) is going to be sent over Matrix,
- a reference ("pill") to a Matrix entity (room alias, room ID, event within a room, user ID) is going to be sent over Matrix,

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kind:maintenance MSC which clarifies/updates existing spec needs-implementation This MSC does not have a qualifying implementation for the SCT to review. The MSC cannot enter FCP. proposal A matrix spec change proposal. Process state.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants